package _base0;

/**
 * 1422. 分割字符串的最大得分
 */
public class No1422 {
    public int maxScore(String s) {
        int answer = 0;
        char[] charArray = s.toCharArray();
        for (int i = 1; i < s.length(); i++) {
            int curVal = 0;
            String left = s.substring(0, i);
            String right = s.substring(i);
            for (char c : left.toCharArray()) {
                if (c == '0') curVal++;
            }
            for (char c : right.toCharArray()) {
                if (c == '1') curVal++;
            }
            answer = Math.max(answer, curVal);
        }
        return answer;
    }
}
